package org.dyz.banana.platform.util.mappergen.fileoutconfig;

import java.io.File;

import com.baomidou.mybatisplus.generator.config.ConstVal;
import com.baomidou.mybatisplus.generator.config.FileOutConfig;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;

public class MapperFileOutConfig extends FileOutConfig {
	//生成VO的路径
	private String entityPath;
	
	public MapperFileOutConfig(String entityPath) {
		this.entityPath = entityPath;
		this.setTemplatePath("/templates/mapper.java.vm");
	}
	
	@Override
	public String outputFile(TableInfo tableInfo) {
		String entityName = tableInfo.getMapperName();
		String entityFile = String.format((entityPath + File.separator + "%s" + ConstVal.JAVA_SUFFIX), entityName);
		return entityFile;
	}

	public String getEntityPath() {
		return entityPath;
	}

	public void setEntityPath(String entityPath) {
		this.entityPath = entityPath;
	}

	
}
